import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:date_format/date_format.dart';

class TimeSelectPage extends StatefulWidget {
  const TimeSelectPage({Key? key}) : super(key: key);

  @override
  _TimeSelectPageState createState() => _TimeSelectPageState();
}

class _TimeSelectPageState extends State<TimeSelectPage> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    print('当前时间${DateTime.now().microsecondsSinceEpoch}');
    print('当前时间${DateTime.fromMicrosecondsSinceEpoch(1630330497922268)}');
    print(formatDate(DateTime.now(), [yyyy, '-', mm, '-', dd]));
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('时间选择器'),
      ),
      body: Column(
        children: [
          RaisedButton(
            onPressed: () {},
            child: Text("原生时间选择器"),
          )
        ],
      ),
    );
  }
}
